import request from '@/utils/request'
// import querystring from 'querystring'

// 获取采购记录详情
export function getDetail(id) {
  return request.get('/purchaseReturn/detail/' + id)
}

// 获取采购记录编辑详情
export function getFindById(id) {
  return request.get('/purchaseReturn/findById/' + id)
}

// 获取采购记录编号
export function getPurchaseCode() {
  return request.get('/purchaseReturn/getPurchaseCode')
} 

// 删除
export function deleteById(id) {
  return request.delete('/purchaseReturn/del/' + id)
}

//新增 
export function add(form) {
  return request.post('/purchaseReturn/save', form)
}

//跟新 
export function update(form) {
  return request.put('/purchaseReturn/save', form)
}

//修改 状态
export function updateStatus(form) {
  return request.put('/purchaseReturn/updateStatus', form)
}

//获取分页数据 
export function page(form, pageSize, currentPage) {
  return request.post('/purchaseReturn/page', {
    param: form,
    pageSize:pageSize,
    pageNo:currentPage
  })
}

// 查询来源单号
export function findSourceCode(returnType, sourceCode) {
  return request.get(`/purchaseReturn/findSourceCode/${returnType}/${sourceCode}`)
}

//获取分页数据 
export function partsPage(form, pageSize, currentPage) {
  return request.post('/purchaseReturn/partsPage', {
    param: form,
    pageSize:pageSize,
    pageNo:currentPage
  })
}